package com.lengxf.aPlugins.bizType.model;

import com.lengxf.aPlugins.bizType.BizInterface;
import com.lengxf.aPlugins.bizType.GroupSubTypeEnum;
import com.lengxf.aPlugins.bizType.GroupTypeEnum;
import com.lengxf.aPlugins.bizType.InteractionModel;

import java.util.List;

/**
 * 过点队列逻辑
 */
public class CruxGuoDian implements BizInterface {

    @Override
    public List<InteractionModel> getInteractionModelList() {
        return List.of(
                readData(),
                request(),
                res_NOK(),
                res_OK(),
                res_ERROR(),
                res_REPORT_COMPLETE(),
                write_guodian()
        );
    }

    //读取参数
    public static InteractionModel readData() {
        List<String> list = List.of(
                "VIN2",
                "BodyType2",
                "BodyNo2",
                "Skid"
        );
        return new InteractionModel(GroupTypeEnum.READ, GroupSubTypeEnum.DATA, list);
    }

    //请求监听参数
    public static InteractionModel request() {
        List<String> list = List.of("Req_ID2" );
        return new InteractionModel(GroupTypeEnum.SUBSCRIPTION, GroupSubTypeEnum.REQUEST, list);
    }

    //写回数据 --关键过点
    public static InteractionModel write_guodian() {
        //此处参考大连代码
        List<String> list = List.of("VIN1", "BodyType1", "BodyNo1" );
        return new InteractionModel(GroupTypeEnum.WRITE, GroupSubTypeEnum.REPORT_20, list);
    }


    //返回1 --关键过点
    public static InteractionModel res_NOK() {
        List<String> list = List.of("NOK" );
        return new InteractionModel(GroupTypeEnum.WRITE, GroupSubTypeEnum.REPORT_NOK, list);
    }

    //返回2 --关键过点
    public static InteractionModel res_OK() {
        List<String> list = List.of("OK" );
        return new InteractionModel(GroupTypeEnum.WRITE, GroupSubTypeEnum.REPORT_OK, list);
    }

    //返回3  --关键过点
    public static InteractionModel res_ERROR() {
        List<String> list = List.of("Error" );
        return new InteractionModel(GroupTypeEnum.WRITE, GroupSubTypeEnum.REPORT_ERROR, list);
    }

    //返回4  --关键过点
    public static InteractionModel res_REPORT_COMPLETE() {
        List<String> list = List.of("complete" );
        return new InteractionModel(GroupTypeEnum.WRITE, GroupSubTypeEnum.REPORT_COMPLETE, list);
    }


}
